cmake_minimum_required(VERSION 3.5)

add_library(kf_lateral kf_lateral.cpp)
target_link_libraries(kf_lateral LinearSys kf)

add_library(kf_lateral2dof kf_lateral2dof.cpp)
target_link_libraries(kf_lateral2dof LinearSys kf yaml-cpp)

add_library(kf_ll_yaw kf_ll_yaw.cpp)
target_link_libraries(kf_ll_yaw LinearSys kf yaml-cpp)

add_library(kf_vy_yaw_error kf_vy_yaw_error.cpp)
target_link_libraries(kf_vy_yaw_error LinearSys kf yaml-cpp)

add_library(kf_ll_4d4s kf_ll_4d4s.cpp)
target_link_libraries(kf_ll_4d4s LinearSys kf yaml-cpp)

add_library(vehicle_kf INTERFACE)
target_link_libraries(vehicle_kf INTERFACE
					kf_lateral
					kf_lateral2dof
					kf_ll_yaw
					kf_ll_4d4s
					kf_vy_yaw_error)
set(test_kf_lateral_path "${CMAKE_CURRENT_SOURCE_DIR}/test/")  
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test/test_kf_lateral_path.h.in ${CMAKE_CURRENT_SOURCE_DIR}/test/test_kf_lateral_path.h)

add_executable(test_kf_lateral test/test_kf_lateral.cpp test/test_kf_lateral_path.h)
target_include_directories(test_kf_lateral PRIVATE ${PYTHON_INCLUDE_DIRS})
target_link_libraries(test_kf_lateral kf  LinearSys
${PYTHON_LIBRARIES} yaml-cpp kf_lateral ${CMAKE_THREAD_LIBS_INIT}) 

add_executable(test_kf_vehicle test/test_kf_vehicle.cpp test/test_kf_lateral_path.h)
target_link_libraries(test_kf_vehicle vehicle_kf ${catkin_LIBRARIES}) 

add_executable(test_kf_vy_yaw_error test/test_kf_vy_yaw_error.cpp test/test_kf_lateral_path.h)
target_link_libraries(test_kf_vy_yaw_error vehicle_kf ${catkin_LIBRARIES}) 